<!-- The image -->
<img class="photo_full" src="<?php echo URL::base_url() . $photo->link; ?>" alt="a"/>

<!-- Prev Next -->
<div class="prev_next">
    <?php if($prev->id != null) : ?>
    <div class="prevbutton">
        <a onclick="navigatePhoto(this);" href="<?php echo URL::site("photo/view/$prev->category_id/$prev->id" . $get);?>">
            <img src="<?php echo URL::base_url() . '/public/image/left.png' ?>" alt="Prev"/>
        </a>
    </div>
    <?php endif; ?>
    
    <?php if($next->id != null) : ?>
    <div class="nextbutton">
        <a onclick="navigatePhoto(this);" href="<?php echo URL::site("photo/view/$next->category_id/$next->id" . $get);?>">
            <img src="<?php echo URL::base_url() . '/public/image/right.png' ?>" alt="Prev"/>
        </a>
    </div>
    <?php endif;?>
</div>

<!-- Info wrapper -->
<div class="photo_info">
    <!-- Deskripsi foto .. Pake view komentar aja kk -->
    <div class="photo_desc">
        <?php
            $photodesc_view = View::factory("photo/photodesc");
            $photodesc_view->photo = $photo;
            echo $photodesc_view;
        ?>
    </div>

    <!-- Score foto -->
    <div class="photo_score_info">
        <div class="photo_score">
            <?php echo $mark; ?>
        </div>
        <?php if($auth_user->id != $view_user->id) : ?>
        <div class="photo_vote">
            <?php if(!isset($evaluator[0]['photo_mark']['mark']) || $evaluator[0]['photo_mark']['mark']!=-1) : ?>
            <a href="<?php echo URL::site("photo/mark/$auth_user->id/$photo->id/-1" . $get); ?>" >
                <img src="<?php echo URL::base_url() . "public/image/angry.png" ?>" alt="Dislike" title="Dislike" />
            </a>
            <?php endif; ?>

            <?php if(!isset($evaluator[0]['photo_mark']['mark']) || $evaluator[0]['photo_mark']['mark']!=1) : ?>
            <a href="<?php echo URL::site("photo/mark/$auth_user->id/$photo->id/1" . $get); ?>" >
                <img src="<?php echo URL::base_url() . "public/image/silent.png" ?>" alt="Silent" title="Silent" />
            </a>
            <?php endif; ?>

            <?php if(!isset($evaluator[0]['photo_mark']['mark']) || $evaluator[0]['photo_mark']['mark']!=2) : ?>
            <a href="<?php echo URL::site("photo/mark/$auth_user->id/$photo->id/2" . $get); ?>" >
                <img src="<?php echo URL::base_url() . "public/image/happy.png" ?>" alt="Like" title="Like" />
            </a>
            <?php endif; ?>
        </div>
        <?php endif; ?>
    </div>

    <!-- clear css sial -->
    <div class="clear"></div>
</div>

<!-- Photo actions -->
<div class="categ_container">
    <div class="categ_title">Actions:</div>
    <?php if($show_form === TRUE || $auth_user->role == "admin") : ?>
    <a href="<?php echo URL::site("photo/delete/$photo->id?uid=$view_user->id"); ?>">Delete</a>
    <?php endif;?>
    <a href="<?php echo URL::site("photo/set_profic/$photo->id") ?>">Set as Profile Pic</a>
</div>

<?php if($show_form == TRUE) : ?>
<!-- Edit photo title -->
<div class="upload_title" onclick="toggleVisibility(document.getElementById('edit_photo_form')); toggleArrowBtn(document.getElementById('arr_edit_photo'))">
    <img src="<?php echo URL::base_url() . 'public/image/arrow_collapse.gif' ?>" alt="" id="arr_edit_photo"/>
    Edit Photo Info
</div>

<!-- Edit photo form -->
<div id="edit_photo_form" class="edit_photo_form" style="display: none">
   <?php echo $form; ?>
</div>
<?php endif; ?>

<!-- Wrapper untuk komen2 -->
<div class="wall_comment">
    <div class="clear"></div>
    <!-- COMMENTS WRAP -->
    <div class="comment_wrap">
        <!-- COMMENT .. -->
        <?php foreach($comments as $c) : ?>
        <div class="wall_comment">
            <img class="profpic" src="<?php echo URL::base_url() . $c["photo"]["link"] ?>" alt="wallimg" />
            <div class = "right">
                <div class="name">
                    <a href="<?php echo URL::site("profile?uid=" . $c["user"]["id"]) ?>"><?php echo $c["user"]["name"] ?></a>
                </div>
                <div class="content">
                    <?php echo $c["photo_comment"]["content"]; ?>
                </div>
                <div class="datetime">
                    <?php echo $c["photo_comment"]["date_stamp"]; ?>
                </div>
                <?php if($auth_user->id == $c["photo_comment"]["sender_id"] || $auth_user->id == $view_user->id) : ?>
                <a class="delete" href="<?php echo URL::site("photo/delete_comment/". $c["photo_comment"]["id"] . "/" . $c["photo_comment"]["photo_id"] . $get) ?>">
                    <img src="<?php echo URL::base_url() . 'public/image/delete.png' ?>" alt="delete" />
                </a>
                <?php endif; ?>
            </div>
            <div class="clear"></div>
        </div>
        <?php endforeach; ?>
        <?php if($view_user->id == $auth_user->id || $photo->comment_access == 0) : ?>
        <!-- Form untuk post comment .. -->
        <div class="wall_comment">
            <form method="post" action="<?php echo URL::site("photo/comment/$auth_user->id/$photo->id" . $get); ?>">
                <img class="profpic" src="<?php echo URL::base_url() . $user_profic; ?>" alt="wallimg" />
                <div class="right">
                    <div class="text_area"><textarea cols="65" rows="3" name="content"></textarea></div>
                    <div class="wall_submission"><input type="submit" name="add_comment" value="post" /></div>
                </div>
                <div class="clear"></div>
            </form>
        </div>
        <?php endif; ?>
    </div>
</div>